import request from '@/utils/request'

// 查询供应商列表-不分页
export function searchSupplier(query) {
  return request({
    url: '/admin/supplier/search',
    method: 'get',
    params: query
  })
}
// 获取供应商用户信息
export function supplierUser(supplierId) {
  return request({
    url: '/admin/supplier/user/'+supplierId,
    method: 'get'
  })
}

// 绑定供应商用户
export function bindSupplierUser(data) {
  return request({
    url: '/admin/supplier/bind',
    method: 'post',
    data: data
  })
}
// 解绑供应商用户
export function unbindSupplierUser(id) {
  return request({
    url: '/admin/supplier/unbind/'+id,
    method: 'post'
  })
}

// 查询供应商订单
export function listSupplierOrder(query) {
  return request({
    url: '/admin/supplier/order/list',
    method: 'get',
    params: query
  })
}

// 导出供应商订单
export function exportSupplierOrder(query) {
  return request({
    url: '/admin/supplier/order/exportSupplierOrder',
    method: 'get',
    params: query
  })
}
// 下载导入模板
export function importTemplate() {
  return request({
    url: '/admin/supplier/order/importTemplate',
    method: 'get'
  })
}
